<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.org/schema/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:a="http://richfaces.org/a4j"
    xmlns:p="http://primefaces.org/ui" 
    template="/layout/template.xhtml">

<ui:define name="body">

    <h:form id="tag" styleClass="edit">

        <p:panel>
            <f:facet name="header">#{tagHome.managed ? 'Edit' : 'Add'} Tag</f:facet>





            <s:decorate id="descricaoField" template="/layout/edit.xhtml">
                <ui:define name="label">Descricao</ui:define>
                <p:inputTextarea id="descricao"
                               cols="80"
                               rows="1"
                              value="#{tagHome.instance.descricao}"/>
            </s:decorate>
				<s:decorate id="dataCriacaoField" template="/layout/display.xhtml">
					<ui:define name="label">Data criação</ui:define>
					<h:outputText value="#{tagHome.instance.dataCriacao}">
						<s:convertDateTime type="both" dateStyle="short" />
					</h:outputText>

				</s:decorate>
            <div style="clear:both">
                <span class="required">*</span>
               Campos Obrigatórios
            </div>

        </p:panel>

        <div class="actionButtons">

            <p:commandButton id="save"
                          value="Save"
                         action="#{tagHome.persist}"
                       disabled="#{!tagHome.wired}"
                       rendered="#{!tagHome.managed}">
                <s:conversationId/>
            </p:commandButton>

            <p:commandButton id="update"
                          value="Save"
                         action="#{tagHome.update}"
                       rendered="#{tagHome.managed}">
                <s:conversationId/>
            </p:commandButton>

            <p:commandButton id="delete"
                          value="Delete"
                         action="#{tagHome.remove}"
                      immediate="true"
                       rendered="#{tagHome.managed}"/>

            <p:button id="cancelEdit"
                   value="Volta"
             propagation="end"
                    outcome="/pages/TagList.xhtml"
                rendered="#{tagHome.managed}"/>

            <p:button id="cancelAdd"
                   value="Volta"
             propagation="end"
                    outcome="/pages/#{empty tagFrom ? 'TagList' : tagFrom}.xhtml"
                rendered="#{!tagHome.managed}"/>

        </div>
    </h:form>

</ui:define>

</ui:composition>
